External Image Commands


ViewJPG("PATH TO EXTERNAL JPG","CENTER")
This command opens external JPG and BMP file in new view window. With optional CENTER as a second parameter, the window will be centered on the screen.
This command is great for Image disks - where user clicks on a small image in the mbd projects and the full version will be opened in the separate window.
Clicking on the window will close it. The window will remain its position for next time if no CENTER command is used.

ReplaceImage("BITMAP OBJECT","PATH TO EXTERNAL JPG FILE")
This command replace the current image in the Bitmap object or Hot-Spot object from external BMP/JPG file. The image Object will be resized to the size of new image or not according the Bitmap object settings (new from 4.9.5) .
ReplaceImage is permanent in one session - that means it will replace the image in the running project until you run the project again or use RunMBD command. Once you replace the image, you may go to other pages and back but the image will stay replaced until you close the application.
ReplaceImage is great if you need to show many big images in the MBD project. For example, catalog of houses. You don't have to put all the images in to the MBD objects (This will make it huge and you will need to split it to multi mbd files). Instead just create one page with one Bitmap Objects and the commands will replace the image in that objects from external jpg file. Like that you can easily create huge image kiosks or catalogs.

The Command works on Bitmap Object as well as on HotSpot. In case of Bitmap Object you will replace existing Bitmap with new one from disk. In case of Hotspot, you will use the hotspot as a placeholder for the new image. Of course, any actions set for hotspot will also apply on the new image.

Example:
You need to create project, which bitmaps need to change often. Instead of redoing the project everytime you simply create the object with default bitmaps or hotspots and then on Page start you use ReplaceImage to load actual jpg into the bitmap object.

Remove Image: you can leave the second parameter in ReplaceImage empty and this will remove the image from the object. ReplaceImage("BITMAP OBJECT","")
You can use this if you need to free some memory - remove images of object, which will be no longer used.

Example :
Your project needs many images. All the images won't fit in the memory so you will need to load particular image on the page and then when going from the page you can remove it to free up some memory.

On Page script, you will use ReplaceImage to load image from disk (CD) into a Hotspot. (Hotspot can be used instead Bitmap Object for creating a virtual placeholder).
Then on all buttons, which are for going from the page (such as Next or Previous) you use ReplaceImage with the empty second parameter. This way the image will be always loaded when the page shows and unloaded when we exiting from the page.

As with many other command you can use page directive for objects:
Page::Object
ReplaceImage("Page 1::Bitmap2","")
This example command will remove Image from Bitmap object called "Bitmap2" on page "Page 1"